﻿using AutoMapper;
using NewRetail.Application.Components.PrintTask.Entity;
using NewRetail.Application.Components.PrintTask.Model;
using NewRetail.Application.Components.StoreValueCard.Entity;
using NewRetail.Application.Components.StoreValueCard.Model;
using NewRetail.Application.Components.TianQue.Entity;
using NewRetail.Application.Components.TianQue.Model;
using NewRetail.Application.Components.WeChat.Member.Entity;
using NewRetail.Application.Components.WeChat.Member.Model;
using NewRetail.Application.Components.WeChat.QrCode.Model;
using SKIT.FlurlHttpClient.Wechat.Api.Models;

namespace NewRetail.Application.Core.AutoMapprConfig
{
    /// <summary>
    /// 创建AutoMapper映射规则，得告诉AutoMapper映射关系
    /// </summary>
    public class AutoMapprProfile : Profile
    {
        public AutoMapprProfile()
        {
            CreateMap<CgibinUserInfoResponse, WeChatMember>();
            CreateMap<CgibinQrcodeCreateResponse, CreateQrCodeResultModel>();
            CreateMap<CgibinUserGetResponse, WeChatUserListDto>();
            CreateMap<CardRechargeRecordEntity, RechargeRecordShowDto>()
                .ForMember(d => d.rechargeAmount, o => o.MapFrom(s => s.rechargeAmount / 100))
                .ForMember(d => d.giftAmount, o => o.MapFrom(s => s.giftAmount / 100));
            CreateMap<CardRechargeSchemeEntity, RechargeSchemeShowDto>();
            CreateMap<CardBalanceChangeEntity, CardBalanceChangesShowDto>();
            CreateMap<PrintTaskEntity, PrintTaskDataResultDto>();
            //天阙
            CreateMap<PosSendNotifyCardDto, TianQuePayRecordEntity>();
            CreateMap<BizOrderDto, BizOrderInfo>();
        }
    }
}
